/*
 * @Author: szx
 * @Date: 2021-12-06 13:44:43
 * @LastEditTime: 2021-12-06 13:48:29
 * @Description:
 * @FilePath: \leetcode\200-299\242\242.js
 */
/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
var isAnagram = function (s, t) {
    const n = s.length;
    if (n != t.length) return false;
    const arr = new Array(26).fill(0);
    for (let i = 0; i < n; i++) {
        arr[s[i].charCodeAt() - 97]++;
        arr[t[i].charCodeAt() - 97]--;
    }
    for (let i of arr) {
        if (i != 0) return false;
    }
    return true;
};
